package com.tsingtao.springboot2.dto;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.tsingtao.springboot2.constants.SexEnum;
import lombok.*;
import lombok.experimental.FieldNameConstants;

import java.util.Map;

@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName(schema = "t_base", value = "user")
@FieldNameConstants
//@KeySequence(value = "customKeyGenerator")
public class User {

//    @TableId(type = IdType.INPUT)
//    @TableId(type = IdType.NONE)
    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField(value = "name")
    private String name;

    @TableField(value = "age")
    private Integer age;

    @TableField(value = "email")
    private String email;

    @TableLogic(value = "0", delval = "1")
    private Integer deleted;

    @TableField(value = "sex")
    private SexEnum sex;

    @TableField(exist = false)
    private String mark;

    @TableField(value = "other_info", typeHandler = FastjsonTypeHandler.class)
    private Map<String, Object> otherInfo;

    @Version
    private Long version;
}
